package com.jingyong.infosite.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.jingyong.infosite.dto.response.LoanWikiResponse;
import com.jingyong.infosite.service.LoanWikiService;

import io.swagger.annotations.Api;

/**
 * @author Hill Dong
 * @date 2018/1/23
 */
@RestController
@Api("网贷百科接口")
public class LoanWikiController {

	@Autowired
	private LoanWikiService loanWikiService;

	@RequestMapping(value = "/loan_wiki", method = RequestMethod.GET)
	public LoanWikiResponse getLoanWikiHomePage() {
		return loanWikiService.getLoanWikiResponse();
	}

	@RequestMapping(value = "/loan_wiki/{type}/{name}", method = RequestMethod.GET)
	public Object getLoanWinkByTitle(@PathVariable String type, @PathVariable String name) {
		return loanWikiService.getLoanWikiByTitle(type, name);
	}

	@RequestMapping(value = "/loan_wiki/{type}/more", method = RequestMethod.GET)
	public Object getLoanWikiByType(@PathVariable String type) {
		return loanWikiService.getLoanWikiByType(type, 10);
	}
}
